package com.coocaa.ops.admin.v1.auth.sys.service.impl;

import com.coocaa.ops.admin.v1.auth.sys.biz.ISysLogOpBiz;
import com.coocaa.ops.admin.v1.auth.sys.model.query.SysLogOpModel;
import com.coocaa.ops.admin.v1.auth.sys.service.ISysLogOpService;
import com.coocaa.ops.common.core.base.model.PageResultModel;
import com.coocaa.ops.common.core.base.util.PageQueryUtil;
import com.coocaa.ops.common.core.biz.auth.entity.SysLogOpEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author bijiahao
 * @date : 2018/11/22.
 * @description:
 * 操作日志
 *
 */
@Service
public class SysLogOpServiceImpl implements ISysLogOpService {
    @Autowired
    private ISysLogOpBiz sysLogOpBiz;
    @Override
    public PageResultModel<SysLogOpEntity> listPage(SysLogOpModel model) {
        Map params = PageQueryUtil.getFilterMap(model);
        int total = sysLogOpBiz.getMapper().selectCountPage(params);
        List<SysLogOpEntity> resultList = null;
        if (total > 0) {
            resultList = sysLogOpBiz.getMapper().queryCommonPageList(params);
        }
        return PageResultModel.getPageResultModel(total, resultList);
    }
}
